import Vue from 'vue'
import Router from 'vue-router'
import store from '@/store/index.js'



import Home from '@/components/Main'

import Index from '@/components/Index'
import CpList from '@/components/CpList'
import CallService from '@/components/CallService'
// import Member from '@/components/Member'
import URegister from '@/components/URegister'
import ULogin from '@/components/ULogin'
import VoucherMain from '@/components/voucher-main'
import Seller from '@/components/Seller'
import SellerInfo from '@/components/SellerInfo'
import MemberInfo from '@/components/MemberInfo'
import Poster from '@/components/Poster'
import Wxlogin from '@/components/Wxlogin'
import MyVoucher from '@/components/MyVoucher'
import UseVoucher from '@/components/UseVoucher'
import OrderRecord from '@/components/OrderRecord'
import MyBalance from '@/components/MyBalance'
import MyCard from '@/components/MyCard' 
import UAtivate from '@/components/UAtivate' 
import Wifi from '@/components/Wifi' 
import VoucherPay from '@/components/voucher-pay'
import URecharge from '@/components/URecharge' 
import AboutUs from '@/components/AboutUs' 

const Member = () => import('@/components/Member').then(m => m.default) //异步加载member.vue

Vue.use(Router)



export default new Router({

  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      meta: { keepAlive: false }//页面被缓存
    }, {
      path: '/Home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/VoucherMain/:code/:fxrid/:hyid',
          name: 'VoucherMain',
          component: VoucherMain,
          meta: { keepAlive: false }//页面不缓存
        },
        {
          path: '/Seller/:sjid/:fxrid',
          name: 'Seller',
          component: Seller, meta: { keepAlive: true }//页面被缓存
        },
        {
          path: '/SellerInfo',
          name: 'SellerInfo',
          component: SellerInfo, meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/CpList',
          name: '点餐界面',
          component: CpList,
          meta: { keepAlive: true }//页面被缓存
        },
        {
          path: '/Member/:openid',
          name: 'Member',
          component: Member,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/URegister',
          name: '注册',
          component: URegister,
          meta: { keepAlive: true }//页面被缓存
        },
        {
          path: '/ULogin',
          name: '登录',
          component: ULogin,
          meta: { keepAlive: true }//页面被缓存
        },
        {
          path: '/MemberInfo',
          name: '会员资料',
          component: MemberInfo,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/Poster',
          name: '抢赏金',
          component: Poster,
          meta: { keepAlive: true }//页面被缓存
        },
        {
          path: '/MyVoucher/:pthyid/:sjid',
          name: 'MyVoucher',
          component: MyVoucher,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/UseVoucher/:id',
          name: 'UseVoucher',
          component: UseVoucher,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/OrderRecord',
          name: 'OrderRecord',
          component: OrderRecord,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/MyBalance',
          name: 'MyBalance',
          component: MyBalance,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/MyCard',
          name: 'MyCard',
          component: MyCard,
          meta: { keepAlive: false }//页面被缓存
        },
        {
          path: '/UAtivate',
          name: 'UAtivate',
          component: UAtivate,
          meta: { keepAlive: true }//页面被缓存
        },
        {
          path: '/URecharge',
          name: 'URecharge',
          component: URecharge,
          meta: { keepAlive: false }//页面被缓存
        }
        ,
        {
          path: '/Wifi',
          name: 'Wifi',
          component: Wifi,
          meta: { keepAlive: true }//页面被缓存
        }
        ,
        {
          path: '/VoucherPay',
          name: 'VoucherPay',
          component: VoucherPay,
          meta: { keepAlive: false }//页面不缓存
        }
        ,
        {
          path: '/AboutUs',
          name: 'AboutUs',
          component: AboutUs,
          meta: { keepAlive: false }//页面不缓存
        }
      ]
    },
    {
      path: '/Wxlogin/:openid',
      name: 'Wxlogin',
      component: Wxlogin,
    }
  ]
});
